import junit.framework.TestCase;
import org.imraniqbal.engine.*;
import org.imraniqbal.pacman.*;

public class LittlePillTest extends TestCase {
	PacmanGame game;
	Map map;
	
	LittlePill test1;
	public LittlePillTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
		map = new Map(30,30);
		
		test1 = new LittlePill(5,5);
		
		game = new PacmanGame();
	}

	//MAPPABLE TESTS
	public void testGetSetX() {
		assertEquals(5,test1.getX()); //set to 5 originally
		test1.setX(2);
		assertEquals(2,test1.getX());
	}
	public void testGetSetY() {
		assertEquals(5,test1.getY()); //set to 5 originally
		test1.setY(2);
		assertEquals(2,test1.getY());
	}
	
	//ITEM TESTS: None
	
	//LITTLEPILL TESTS
	public void testAction() {
		map.addMappable(test1);
		assertEquals(true,map.getMappable(5,5).contains(test1));

		//pacman moves onto LittlePill
		Pacman tempPacman = new Pacman(5,5);
		map.addMappable(tempPacman);
		test1.action(game, map);
		assertEquals(false,map.getMappable(5,5).contains(test1));
		assertEquals(10,game.getScore()); //score should go up by 10 now
	}
	
	
	
	
	
	
	
	
	
}
